home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
smaltalk
/
stv.lha
/
STV
/
ISA
/
artifact
/
oddsends.st
< prev
next >
Wrap
Text File
|
1993-07-23
|
1KB
|
50 lines
"
Smalltalk Tricks (From "Pieces of Cake")
by Tom Wrensch & Gene Korienek
See odsends.doc for more information on these methods."!
!Object methods !
ifNil: aBlock
"Answer myself since I'm not nil."
^self! !
!UndefinedObject methods !
ifNil: aBlock
"Answer the value of aBlock."
^aBlock value! !
!Context methods !
untilFalse: aBlock
"Repeat myself until aBlock evaluates as
false."
self value.
^aBlock whileTrue: self! !
!Context methods !
untilTrue: aBlock
"Repeat myself until aBlock evaluates as
true."
self value.
^aBlock whileFalse: self! !
!Symbol methods !
value: anObject
"Answer anObject sent the message represented
by myself. This makes it possible to use a
symbol in place of a one argument block."
^anObject perform: self! !
!Symbol methods !
value: anObject1 value: anObject2
"Answer anObject1 sent the message represented
by myself with anObject2 as an argument. This
makes it possible to use a symbol in place of
a two argument block."
^anObject1 perform: self with: anObject2! !